set inten on
STORE 0 TO CNT,CR
play=savescreen(0,0,24,79)
sele 1
set exclu off
use &dr&f1 inde &dr&f11
seek ALLTRIM(kunci)
if .not. eof()
   DO WHILE left(drug_name,len(kunci))=alltrim(kunci)
      CNT=CNT+1
      skip
   ENDDO
   IF CNT=0
      RETURN
   ENDIF
   DECLARE FILD[CNT]
   DECLARE drcod[CNT]
   DECLARE CNAM[CNT]
   seek ALLTRIM(kunci)
   if .not. eof()
      DO WHILE left(drug_name,len(kunci))=alltrim(kunci)
* Buu 13-05-2004 : Not show if for_sale = false
	   IF FOR_SALE
           CR=CR+1
           nm=alltrim(drug_name)+' '+alltrim(drug_type)+' '+alltrim(drug_qant)+' '+alltrim(drug_unit)
           FILD[CR]=subs(NM,1,42)+space(42-len(nm))+subs(generic,1,20)+'  '+drug_code
           drcod[CR]=drug_CODE
           CNAM[CR]=drug_NAME
	   ENDIF
* Buu 13-05-2004 End
         SKIP
      ENDDO
   endif
   set colo to w/b
   inkey()
   set colo to w+/rb,gr+/r
   @ 15,3 clea to 22,75
   @ 15,3 to 22,75 double
   pilih=achoice(16,5,21,73,FILD)
   IF LASTKEY()=13
      DARF=FILD[PILIH]
      kode=drcod[PILIH]
      name=CNAM[PILIH]
   else
      restscreen(0,0,24,79,play)
*      close database
*      close index
*      set color to n/bg/w+/n
      return
   ENDIF
else
   name=space(32)
endif
return
